Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PyROS Subproblem Initialization Routines #3071

Merged
merged 22 commits into from
Jan 16, 2024

Conversation

shermanjasonaf
Copy link
Contributor

Summary/Motivation

Implement updates to the PyROS subproblem initialization routines. These updates have been observed to improve the computational performance and reliability of PyROS for both small-scale and large-scale instances.

Changes proposed in this PR:

  • Initialize second-stage variables $z^k$ and state variables $y^k$ of master problem of iteration $k$ to their values in the worst-case separation solution of iteration $k - 1$. Consequently, only the performance constraints of master block $k$ are violated by the initial master point. Drop equality constraint slack variables from the slack-based master feasibility problem.
  • Initialize separation problem for each performance constraint to variable values from master block with worst violation of the performance constraint. Hence, each separation problem is initialized to the best known solution (and provided the set is not of type DiscreteScenarioSet, the solution is feasible).
  • Refactor decision rule variable and constraint declaration routines.
  • Refactor decision rule polishing problem routine. Ensure auxiliary variables are initialized to the initial values of the quantities they are meant to represent, rather than the currently used blanket value of 1E6.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@shermanjasonaf shermanjasonaf changed the title New subproblem inits pr Update PyROS Subproblem Initialization Routines Dec 17, 2023
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (d5b53d5) 88.09% compared to head (c104954) 88.32%.
Report is 100 commits behind head on main.

Files Patch % Lines
pyomo/contrib/pyros/util.py 97.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3071      +/-   ##
==========================================
+ Coverage   88.09%   88.32%   +0.22%     
==========================================
  Files         774      776       +2     
  Lines       91538    93684    +2146     
==========================================
+ Hits        80644    82747    +2103     
- Misses      10894    10937      +43     
Flag Coverage Δ
linux 85.99% <56.55%> (+0.53%) ⬆️
osx 75.53% <56.55%> (+0.06%) ⬆️
other 86.17% <56.55%> (+0.53%) ⬆️
win 83.39% <56.55%> (+0.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shermanjasonaf
Copy link
Contributor Author

Feel free to add @natalieisenberg as a reviewer.

Copy link
Contributor

@natalieisenberg natalieisenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good! I like the new system for managing decision rules.

Copy link
Contributor

@mrmundt mrmundt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same general comment as before that, if PyROS is ever promoted out of contrib, I will request that instances of master are changed to some other more inclusive language choice.

Copy link
Member

@jsiirola jsiirola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor things, but nothing to prevent merging

@@ -2,6 +2,18 @@
PyROS CHANGELOG
===============

-------------------------------------------------------------------------------
PyROS 1.2.9 12 Oct 2023
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the date still 12 Oct?

targets.extend(
[
con
for con in blk.component_data_objects(
Constraint, active=True, descend_into=True
)
if con not in dr_eqs
if not con.equality
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that con.equality will only be True if the constraint was declared as an equality constraint. Ranged inequalities will have con.equality == False, even if the upper and lower bounds are the same. Is that an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of #2206, ranged inequality constraints with identical bounds are recast to equality constraints during the preprocessing step by util.transform_to_standard_form.

@jsiirola jsiirola merged commit 6d392a8 into Pyomo:main Jan 16, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants